package L1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Left-pad
 */
public class _032 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l1 = reader.readLine().split(" ");
        String l2 = reader.readLine();
        int N = Integer.valueOf(l1[0]);
        String s = l1[1];
        if (l2.length()<=N){
            for (int i=0;i<N-l2.length();i++){
                System.out.print(s);
            }
            System.out.println(l2);
        }else{
            for (int i=l2.length()-N;i<l2.length();i++){
                System.out.print(l2.charAt(i));
            }
        }
    }
}
